﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lib
{

    public enum DataBaseType
    {
        mysql, sqlserver, oracle
    }
    /// <summary>
    /// 数据库管理工厂
    /// </summary>
    public class DataBaseFactory
    {
        public static IDataBase getNewConnection()
        {
            return DataBaseFactory.getNewConnection(DataBaseType.mysql);
        }
        public static IDataBase getNewConnection(DataBaseType db)
        {
            switch (db)
            {
                case DataBaseType.mysql: return new MySqlDB();
                default: return null;
            }
        }
    }
}
